import Feather from "react-native-vector-icons/Feather";
import { TextInput, View, StyleSheet, TouchableOpacity } from "react-native";
import AntDesign from "react-native-vector-icons/AntDesign";
import Colors from '../../util/Colors';
import React from "react";
import { Button } from "@rneui/base";
export default function(props){
  let enable = props.enable === undefined ? true : props.enable;
  let valueO = '';

  const getValue = () => {
    //console.log(valueO);
    return valueO;
  }
  return(
    <View style={[props.style, styles.container]}>

      <AntDesign name={'search1'} size={20} color={Colors.colorPrimary} />
      <TouchableOpacity style={styles.text} onPress={props.onPress}>
      <TextInput
        style={styles.text}
        placeholder={'请输入你想听的'}
        editable={enable}
        autoFocus={props.focus}
        onChangeText={value => (valueO = value)}
        onPressIn={props.onPress}
      />
      </TouchableOpacity>
      <TouchableOpacity onPress={props.onPress}>
        <Feather name={'check'} size={20} color={Colors.colorPrimary}/>
      </TouchableOpacity>
    </View>
  )
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    flexDirection: 'row',
    height: 36,
    borderRadius: 18,
    paddingHorizontal: 10,
    backgroundColor: '#ffffffdd',
    alignItems: 'center',
  },
  text: {
    flex: 1,
    fontSize: 13,
    marginLeft: 4,
    padding: 0,
    color: '#333333'
  },

});
